package Demo03;

public class Test {
    public static void main(String[] args) {
        Student student1 =new Student("张三","男",23);
        Student student2 =new Student("张三","男",23);
        Student student3 =new Student("张三","女",23);

        //   1.    重写toString方法
        System.out.println(student1);
        System.out.println(student2);

        //   2.   比较
      boolean flag1 =  (student1.equals(student2));
        System.out.println(flag1);

        boolean flag2 =  (student1.equals(student3));
        System.out.println(flag2);
    }
}
